
console.log('plugin start');
chrome.runtime.onMessage.addListener(
	function(request, sender, sendResponse){
		if (request.action === 'download'){
			const now1 = new Date().getTime();
			chrome.downloads.download({
					url: request.url,
					filename: `down-${now1}.txt`,
					conflictAction: "uniquify",
					saveAs: false
				},
				function(res){});
			console.log(request.url);
		}
		return true; // 保留消息通道打开，以便异步发送响应
	}
);


